<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>人员申请单信息读取</title>
<script type="text/javascript">
	var checkStr = "0123456789";
	function query() {

		var number = document.getElementById("number").value;
		if (number.length != 11) {
			alert("单据编号为11位数字，请重新检查。谢谢！");
			return false;
		}
		for ( var i = 0; i < number.length; i++) {
			var temp = number.charAt(i);
			if (checkStr.indexOf(temp) == -1) {
				alert("单据编号的半角阿拉伯数字，请重新检查。谢谢！");
				return false;
			}
		}

		window.parent.document.getElementById("lodingDiv").style.height = window.parent.document.body.clientHeight
				- 3 + "px";
		window.parent.document.getElementById("lodingDiv").style.display = '';

		var xmlhttp = null;
		if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera,
			xmlhttp = new XMLHttpRequest();
		} else {// code for IE6, IE5
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		xmlhttp.onreadystatechange = function() {
			if (xmlhttp.readyState == 4) {
				if (xmlhttp.status == 200) {
					text = xmlhttp.responseText;

					var result = eval('(' + text + ')');
					if (result.success == true) {
						var updoc = window.dialogArguments.document;
						// select 申请编号, 申请公司,申请部门 , 申请人, 
						//申请原因, 申请岗位, 需求人数, 职级, 
						//申请日期, 需求签批日期,要求到位日期, 性别,
						//年龄,学历,专业,工作经验 from fy_requirement_view where
						// 申请编号 = ?
						var checkStr = '性别,年龄,学历,专业,工作经验';
						for ( var key in result.data) {
							if (checkStr.indexOf(key) == -1) {
								updoc.getElementById("my:" + key).value = result.data[key];
							} else {
								updoc.getElementById("my:人员资格要求_" + key).value = result.data[key];
							}
						}
						window.close();
					} else {
						alert(result.data);
					}
				} else {
					alert("连接服务器异常");
				}

				window.parent.document.getElementById("lodingDiv").style.display = 'none';
			}
		};
		xmlhttp.open("get",
				"../../../../oa2hrController.do?method=queryRequirementInfo&number="
						+ document.getElementById("number").value, true);
		xmlhttp.send();

		return false;
	}
</script>
</head>
<body>
	<div style="text-align: center; margin-top: 20px; font: 10pt 微软雅黑;">
		<form onsubmit="return query();">
			<table border="0">
				<tr>
					<td>人员需求申请单编号：</td>
					<td><input id="number" style="width: 150px;font: Arial 10pt; color: #000066;" /></td>
					<td align="right"><input type="submit" value="确认" /></td>
				</tr>
			</table>
		</form>
	</div>
</body>
</html>